<div class="content">
<?php echo $this->Html->css('jquery-ui/jquery-ui-1.10.4.custom.min')?>
  		<div class="buzhou bg01">	
         	<ul>
            	<li class="my01">我的购物车</li>
                <li class="my02">订单信息</li>
                <li class="my03">确认支付</li>
            </ul>
         </div>
   	  	<div class="clear"></div>
    	 <table width="100%" border="0" cellspacing="0" cellpadding="0" class="goumai">
              <thead>
                  <tr>
                    <td width="9%" height="41" bgcolor="#7e7e7e"><span></span></td>
                    <td width="54%" height="41" bgcolor="#7e7e7e">商品名称</td>
                    <td width="9%" height="41" align="center" bgcolor="#7e7e7e">座位</td>
                    <td width="10%" height="41" align="center" bgcolor="#7e7e7e">单价</td>
                    <td width="8%" height="41" align="center" bgcolor="#7e7e7e">数量</td>
                    <td width="10%" height="41" align="center" bgcolor="#7e7e7e">操作</td>
                </tr>
              </thead>
              <tbody>
              	  <tr id = 'item-empty' <?php if($carts['count']>0){echo 'style=display:none';}?>>
                    <td height="80" style = 'text-align:center' colspan="6">
                    	您的购物车为空
                     </td>
                  </tr>
              	  <?php $i=-1;foreach($carts['data'] as $item):$i++;?>
                  <tr id = 'item-<?php echo 'seat_'.$item['id'] ?>'>
                    <td height="80" class="gouxuan">
                    </td>
                    <td height="80">
                    	<?php 
                    		//pr($item['object']);
                    		echo $title = $item['object']['Ticket']['title'];
							echo '<br/>上映时间：'.$item['object']['TicketShowing']['showtime'];
                    	?>
                    	
                    </td>
                    <td height="80" style="text-align:center;color:green;">
                    	<?php echo $item['title']?>
                    </td>
                    <td height="80" align="center">
	                    <?php $del = $item['param']==1?'del_line':'';?>
                    	<span class = 'del_price <?php echo $del?>'>　¥<?php echo $item['price']?>　</span>
                    </td>
                    <td height="80" align="center">
                    	1
                    </td>
                    <td height="80" align="center">
                    	<a href="javascript:;" onclick = "CART.delItem('<?php echo 'seat_'.$item['id']?>')">删除</a>
                    </td>
                  </tr>
                  <?php endforeach;?>
              </tbody>
              <tfoot>
                  <tr>
                    <td height="130" colspan="6" valign="top">
                        <ul class="money floatr">
                            <li>
                                <span>总计：</span>
                                <em id = 'v_count'><?php echo $carts['count']?>张</em>
                            </li>
                            <li class="yingfu">
                                <span>应付金额：</span>
                                <em id = 'v_price'>¥<?php echo $carts['price']?></em>
                            </li>
                        </ul>
                    </td>
                  </tr>
              </tfoot>
          </table>
         <div class="tijiao">
         	<span>
         		<?php $Auth = $this->Session->read('Auth.User');?>
         		<?php if(!empty($Auth)):?>
        		<?php echo $this->Html->link('去结算',citylink('UserOrders','add'))?>
        		<?php else:?>
        		<a href="javascript:;" onclick = 'CART.confirm()'>去结算</a>
        		<?php endif;?>
         	</span>
         </div>   
         
         <?php if(empty($Auth)):?><script>$(function(){CART.nologinTips();})</script><?php endif;?>
         
         <div class="clear"></div>
         <div class="browse Box">
         	<h3><span>您浏览过的票品</span></h3>	
            <ul>
            
            
            	<?php 
		    	if($this->Session->check('RecentTicket')){
			    	$recentTicket = $this->Session->read('RecentTicket');
		    	}else{
		    		$recentTicket = array();
		    	}
		    	$recentTicket = array_reverse($recentTicket,true);
		    	$i = 0;
		    	foreach ($recentTicket as $rt): $i++;
		    	if($i>3)break;
		    	?>
		    	<li>
                	<dl>
                    	<dt>
                    		<?php 
								if(isset($rt['ListPhoto']['file_path']))
									$pic = $rt['ListPhoto']['file_path'];
								else 
									$pic = 'default/himg_19.jpg';
							?>
                    		<?php $image = $this->Html->image($pic,array(
									'alt'=>$rt['Ticket']['title'],
									'title'=>$rt['Ticket']['title'],
                    				'width'=>'110',
                    				'height'=>'150',
								  ));
							?>
							<?php echo $this->Html->link($image,
											TicketView($rt),
											array('escape'=>false)
									  )
								?>
                    	</dt>
                        <dd>
                        	<?php echo $this->Html->link($rt['Ticket']['title'],
		    						TicketView($rt),
		                        	array('title'=>$rt['Ticket']['title'],'class'=>'uer')
		                       )
							?>
                            <p class="txt01">时间：<?php echo $rt['Ticket']['showtime']?></p>
                            <p class="txt02">场馆：
                            	<?php echo $this->Html->link($rt['Venue']['title_cn'],
								            		citylink('Venues','view')+array($rt['Venue']['id']),
								            		array('title'=>$rt['Venue']['title_cn']));
								            ?>
                            </p>
                        </dd>
                    </dl>
                </li>
		    	<?php endforeach;?>
            
                <div class="clear"></div>
            </ul>
         </div>
    </div>	